
// Copyright (c) 2002 HTHK
package admin.system.rolefunc;

import com.ffpc.sql.*;

import java.sql.*;

import admin.system.rolefunc.RoleFunc;

import java.util.Vector;

/**
 * A Class class.
 * <P>
 * @author HTHK
 */
public class RoleFuncProcess
{
    public static RoleFuncBean createBean()
    {
        return new RoleFunc();
    }

    public static int insert(Connection con, RoleFuncBean roleFuncBean)
      throws DataException
    {
        RoleFunc roleFunc = (RoleFunc)roleFuncBean;
        roleFunc.setConnection(con);
        return roleFunc.insert();
    }

    public static int update(Connection con, RoleFuncBean roleFuncBean)
      throws DataException
    {
        RoleFunc roleFunc = (RoleFunc)roleFuncBean;
        roleFunc.setConnection(con);
        return roleFunc.update();
    }

    public static int delete(Connection con, RoleFuncBean roleFuncBean)
      throws DataException
    {
        RoleFunc roleFunc = (RoleFunc)roleFuncBean;
        roleFunc.setConnection(con);
        return roleFunc.delete();
    }

    public static RoleFuncBean[] find(Connection con, RoleFuncBean roleFuncBean)
      throws DataException
    {
        RoleFunc roleFunc = (RoleFunc)roleFuncBean;
        BaseSqlCommand buc = new BaseSqlCommand(con);
        Vector rows = buc.find(roleFunc);
        RoleFuncBean[] beans = new RoleFunc[rows.size()];
        for (int i=0;i<rows.size();i++)
        {
            RoleFunc bean = new RoleFunc();
            bean.setColumns((Column[])rows.get(i));
            beans[i] = bean;
        }
        return beans;
    }
}


